package com.zlm.custom.list;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import lombok.Data;

import java.util.HashMap;
import java.util.Map;

/**
 * {@code }
 *
 * @author zlm
 * @since 2025/7/7
 */
@Data
public class Demo {

    private String name;
    // 扩展字段
    private Map<String,Object> addProps = new HashMap<>();

    //存储扩展字段
    @JsonAnySetter
    public void setAddProps(String key,Object value){
        addProps.put(key,value);
    }
    //序列化时扩展字段当作正常字段输出
    @JsonAnyGetter
    public Map<String,Object> getAddProps(){
        return addProps;
    }

}
